package br.com.android.financas.fragments;

import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import br.com.android.financas.R;

public class ApagarDespesa extends DialogFragment {

	private CheckBox todas;
	private CheckBox frente;

	public ApagarDespesa() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.apagar_despesa, container);
		todas = (CheckBox) view.findViewById(R.apagar.todasGrupo);
		frente = (CheckBox) view.findViewById(R.apagar.paraFrente);
		getDialog().setTitle("Apagar Movimenta\u00e7\u00e3o");

		todas.setOnCheckedChangeListener(new OnCheckedChangeListener() {

			@Override
			public void onCheckedChanged(CompoundButton arg0, boolean check) {
				if(check){
					frente.setVisibility(View.INVISIBLE);
				}else
					frente.setVisibility(View.VISIBLE);
			}
		});

		return view;
	}
}
